<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

namespace builder\table\util;

use builder\table\HelperInterface;
use builder\table\util\thead\Checkbox;
use builder\table\util\thead\Field;
use builder\table\util\thead\Number;
use builder\table\util\thead\Radio;
use builder\table\util\thead\Switch1;
use builder\table\util\thead\Toolbar;

/**
 * 表头助手
 * @author cleverstone
 * @since ym2.0
 */
class TableHeadHelper implements HelperInterface
{
    /**
     * 普通字段列
     * @param string $field
     * @return Field
     */
    public function field($field)
    {
        return new Field($field);
    }

    /**
     * checkbox列
     * @return Checkbox
     */
    public function checkbox()
    {
        return new Checkbox();
    }

    /**
     * radio列
     * @return Radio
     */
    public function radio()
    {
        return new Radio();
    }

    /**
     * 序号列
     * @return Number
     */
    public function number()
    {
        return new Number();
    }

    /**
     * toolbar列
     * @return Toolbar
     */
    public function toolbar()
    {
        return new Toolbar();
    }

    /**
     * 开关状态列
     * @param string $field
     * @return Switch1
     */
    public function switch1($field)
    {
        return new Switch1($field);
    }
}